import json

import requests

# 薪经咨询登录URL（刘清华的网站）
url = "http://teacher-wang.com:8899/passport/login"
# 伪装浏览器版本
headers = {
    "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
}
# 配置要登录的用户名
payload = {
    "mobile": "13146060336",
    "password": "111111"
}

# 进行登录
r = requests.post(url=url, headers=headers, json=payload)

print("请求头是：", r.request.headers)
print("请求体是：", r.request.body)

print("响应状态码为:", r.status_code)

print("响应头为：", r.headers)

print("响应的cookie为:")
set_cookie = requests.utils.dict_from_cookiejar(r.cookies)
print(set_cookie)

print("响应体为：", type(r.json()))
print("响应体为：", r.json())
# # 当然也可以用
# print(json.loads(r.text))

